home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / Disks.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  3.4 KB  |  147 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Disks.h
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1985-1991,1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __DISKS__
  19. #define __DISKS__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.     sony                        = 0,
  53.     hard20                        = 1
  54. };
  55.  
  56. /*
  57.     Note:
  58.     
  59.     qLink is usually the first field in queues, but back in the MacPlus
  60.     days, the DrvSts record needed to be expanded.  In order to do this without
  61.     breaking disk drivers that already added stuff to the end, the fields 
  62.     where added to the beginning.  This was originally done in assembly language
  63.     and the record was defined to start at a negative offset, so that the qLink
  64.     field would end up at offset zero.  When the C and pascal interfaces where
  65.     made, they could not support negative record offsets, so qLink was no longer
  66.     the first field.  Universal Interfaces are auto generated and don't support
  67.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a 
  68.     none zero offset.  Assembly code which switches to Universal Interfaces will
  69.     need to compensate for that.
  70.  
  71. */
  72.  
  73. struct DrvSts {
  74.     short                             track;                        /* current track */
  75.     char                             writeProt;                    /* bit 7 = 1 if volume is locked */
  76.     char                             diskInPlace;                /* disk in drive */
  77.     char                             installed;                    /* drive installed */
  78.     char                             sides;                        /* -1 for 2-sided, 0 for 1-sided */
  79.     QElemPtr                         qLink;                        /* next queue entry */
  80.     short                             qType;                        /* 1 for HD20 */
  81.     short                             dQDrive;                    /* drive number */
  82.     short                             dQRefNum;                    /* driver reference number */
  83.     short                             dQFSID;                        /* file system ID */
  84.     char                             twoSideFmt;                    /* after 1st rd/wrt: 0=1 side, -1=2 side */
  85.     char                             needsFlush;                    /* -1 for MacPlus drive */
  86.     short                             diskErrs;                    /* soft error count */
  87. };
  88. typedef struct DrvSts DrvSts;
  89.  
  90. struct DrvSts2 {
  91.     short                             track;
  92.     char                             writeProt;
  93.     char                             diskInPlace;
  94.     char                             installed;
  95.     char                             sides;
  96.     QElemPtr                         qLink;
  97.     short                             qType;
  98.     short                             dQDrive;
  99.     short                             dQRefNum;
  100.     short                             dQFSID;
  101.     short                             driveSize;
  102.     short                             driveS1;
  103.     short                             driveType;
  104.     short                             driveManf;
  105.     short                             driveChar;
  106.     char                             driveMisc;
  107. };
  108. typedef struct DrvSts2 DrvSts2;
  109.  
  110.  
  111. enum {
  112.     kdqManualEjectBit            = 5
  113. };
  114.  
  115. EXTERN_API( OSErr )
  116. DiskEject                        (short                     drvNum);
  117.  
  118. EXTERN_API( OSErr )
  119. SetTagBuffer                    (void *                    buffPtr);
  120.  
  121. EXTERN_API( OSErr )
  122. DriveStatus                        (short                     drvNum,
  123.                                  DrvSts *                status);
  124.  
  125.  
  126.  
  127. #if PRAGMA_STRUCT_ALIGN
  128.     #pragma options align=reset
  129. #elif PRAGMA_STRUCT_PACKPUSH
  130.     #pragma pack(pop)
  131. #elif PRAGMA_STRUCT_PACK
  132.     #pragma pack()
  133. #endif
  134.  
  135. #ifdef PRAGMA_IMPORT_OFF
  136. #pragma import off
  137. #elif PRAGMA_IMPORT
  138. #pragma import reset
  139. #endif
  140.  
  141. #ifdef __cplusplus
  142. }
  143. #endif
  144.  
  145. #endif /* __DISKS__ */
  146.  
  147.